﻿namespace Seesmic.HelloTipi.Helpers
{
using System;
    using System;
    using System.Globalization;
    using System.Windows;
    using System.Windows.Data;

    public class UrlToUriConverter : IValueConverter
    {

        #region IValueConverter Members

        public object Convert(object value, System.Type targetType, object parameter, CultureInfo culture)
        {
            //HelloTipiPlugin.LogInfo((string)value);
            
            Uri r = new Uri((string)value);

            //HelloTipiPlugin.LogInfo((string)value + " : " + r.AbsoluteUri);
            
            return new Uri((string)value);
        }

        public object ConvertBack(object value, System.Type targetType, object parameter, CultureInfo culture)
        {
            return ((Uri)value).AbsoluteUri;
        }

        #endregion
    }
}
